/*
 * Copyright 2015-2016 Imply Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../imports';

.simple-list {
  overflow: auto;

  .row {
    display: flex;
    padding: 10px 4px 10px 6px;
    cursor: move;

    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;

    &:not(:first-child) {
      border-top: 1px solid $border-super-light;
    }

    &.dragged {
      background: $background-lightest;

      &:hover .drag-handle {
        opacity: 0;
      }
    }

    &.drop-before::after {
      content: '';
      position: absolute;
      top: -1px;
      left: 0;
      right: 0;
      height: 2px;
      border-top: 2px dashed $brand;
      background: $white;
    }

    &.drop-after::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 0;
      right: 0;
      height: 2px;
      border-bottom: 2px dashed $brand;
      background: $white;
    }

    .svg-icon {
      width: 19px;
      height: 19px;
      margin: 6px;

      path {
        fill: $brand;
      }
    }

    .drag-handle {
      position: absolute;
      top: 10px;
      left: -14px;
      pointer-events: none;
      opacity: 0;

      .svg-icon path {
        fill: $text-lightest;
      }
    }

    .text {
      flex: 1 1;
      overflow: auto;
      padding: 0 10px;

      > * {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      .title {
        color: $text-medium;
        line-height: 16px;
        margin-bottom: 2px;
      }

      .description {
        color: $text-lighter;
        font-size: 12px;
        line-height: 14px;
      }
    }

    .actions {
      button {
        @extend %button-light;
        border-radius: 20px;
      }
    }

    &:hover {
      .drag-handle {
        opacity: 1;
      }
    }
  }
}
